﻿using ArtMath.Core.Data;
using System.Windows.Forms;

namespace ArtMath.AuxiliaryTool
{
    public abstract class RectangleDragger : ToolBase
    {
        protected RectangleD initRect;
        public RectangleDragger(PointD initLocation)
        {
            initRect = new RectangleD(initLocation, SizeD.Empty);
        }
        public RectangleD InitialRectangle
        {
            get { return initRect; }
        }
        public override void MouseMove(MouseMoveEventArgs e)
        {
            switch (e.Button)
            {
                case MouseButtons.Left:
                case MouseButtons.Right:
                    initRect.Width = e.CurrentPosition.X - initRect.Left;
                    initRect.Height = e.CurrentPosition.Y - initRect.Top;
                    break;
            }
        }
    }
}
